home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computer Select (Limited Edition)
/
Computer Select.iso
/
pcmag
/
v10n15
/
vectors.h
< prev
Wrap
Text File
|
1991-07-30
|
805b
|
20 lines
// VECTORS.H
// Class definition for 2-dimensional vectors
// Member functions are defined in VECTORS.CPP
// Copyright (C) 1991 Ziff Davis Communications
// PC Magazine * Ray Duncan
class VECTOR { // vector data type
double magnitude; // magnitude storage
double direction; // direction storage
double deg2rad(double); // convert degrees to radians
double rad2deg(double); // convert radians to degrees
public:
void display(void); // display vector
void set(double, double); // set vector value
void add(double, double); // add vectors
} ;
const double pi = 3.141592654; // constant Pi